/**
 * Created by marchen on 2015/3/6.
 * gulp 任务自动化
 */
var gulp = require('gulp');
var jshint = require('gulp-jshint');
var header = require('gulp-header');

var now = new Date().toLocaleString();
//gulp 默认任务
gulp.task('default', function() {
    console.log('hello gulp');
});

//gulp js文件检查插件
gulp.task('jshint', function() {
    return gulp.src('./public/javascripts/*.js')
        .pipe(jshint())
        .pipe(jshint.reporter('default'));
});

//gulp 给文件添加头部banner
gulp.task('header', function() {
    return gulp.src('./README.md')
        .pipe(header('最新修改时间<%= time %>\n',{time : now}))
        .pipe(gulp.dest('./dist/'));
});
